package cn.yangliu.nacos.oauth2.config.store;

import java.io.Serializable;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.oauth2.provider.TokenRequest;

/**
 * The type of nacos.
 *
 * @author 问道于盲
 * @date 2020 -01-06
 */
@Data
public class OAuthRequest {

    /**
     * current class instance's member.
     * The Client id.
     */
    private String clientId;

    /**
     * current class instance's member.
     * The Scope.
     */
    private Set<String> scope = new HashSet<>();

    /**
     * current class instance's member.
     * The Request parameters.
     */
    private Map<String, String> requestParameters = Collections
            .unmodifiableMap(new HashMap<>());

    /**
     * current class instance's member.
     * The Resource ids.
     */
    private Set<String> resourceIds = new HashSet<>();

    /**
     * current class instance's member.
     * The Authorities.
     */
    private Collection<? extends GrantedAuthority> authorities = new HashSet<>();

    /**
     * current class instance's member.
     * The Approved.
     */
    private boolean approved = false;

    /**
     * current class instance's member.
     * The Refresh.
     */
    private TokenRequest refresh = null;

    /**
     * current class instance's member.
     * The Redirect uri.
     */
    private String redirectUri;

    /**
     * current class instance's member.
     * The Response types.
     */
    private Set<String> responseTypes = new HashSet<>();

    /**
     * current class instance's member.
     * The Extensions.
     */
    private Map<String, Serializable> extensions = new HashMap<>();


}
